package com.itheima.xx.dao;

import com.itheima.xx.pojo.User;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

/**
 * Description:
 *
 * @author codermao
 * @date 2023/11/1 14:13
 */
public interface UserMapper {

    @Select("select * from user where username = #{userName}")
    User queryUserByUserName(@Param("userName") String userName);

    //2.添加用户的方法
    @Insert("insert into user values(null,#{userName},#{password})")
    void regist(User user);

    @Select("select * from user where username=#{userName} and password=#{password}")
    User login(User user);
}
